// ==========================================================================
// gin-sns auto gen code.
// date：2021-02-21 13:45:53 +0800 CST
// path: app/model/module/collectarticle/collectarticle_entity.go
// author：jon
// ==========================================================================

package collectarticle

import (
	"time"
)

// 数据表映射结构体
type Entity struct {
	Id             int64     `json:"id" xorm:"not null pk autoincr comment('') bigint(20)"`
	UserId         int64     `json:"user_id" xorm:"comment('用户id') bigint(20)"`
	RuleId         int64     `json:"rule_id" xorm:"comment('规则id') bigint(20)"`
	LinkId         int64     `json:"link_id" xorm:"comment('链接id') bigint(20)"`
	Title          string    `json:"title" xorm:"comment('名称') varchar(128)"`
	Summary        string    `json:"summary" xorm:"comment('总揽') text"`
	Content        string    `json:"content" xorm:"comment('内容') longtext"`
	ContentType    string    `json:"content_type" xorm:"comment('内容类型') varchar(32)"`
	SourceUrl      string    `json:"source_url" xorm:"comment('源地址') text"`
	SourceId       string    `json:"source_id" xorm:"comment('源id') varchar(1024)"`
	SourceUrlMd5   string    `json:"source_url_md5" xorm:"comment('源地址MD5') varchar(255)"`
	SourceTitleMd5 string    `json:"source_title_md5" xorm:"comment('源名称MD5') varchar(255)"`
	ArticleId      int64     `json:"article_id" xorm:"comment('文章id') bigint(20)"`
	Status         int       `json:"status" xorm:"comment('0未审核 1正常状态 2审核未通过 3删除') tinyint(2)"`
	CreateTime     time.Time `json:"create_time" xorm:"comment('创建时间') datetime"`
}

//新增页面请求参数
type AddReq struct {
	UserId         int64  `form:"userId" `
	RuleId         int64  `form:"ruleId" `
	LinkId         int64  `form:"linkId" `
	Title          string `form:"title" `
	Summary        string `form:"summary" `
	Content        string `form:"content" `
	ContentType    string `form:"contentType" `
	SourceUrl      string `form:"sourceUrl" `
	SourceId       string `form:"sourceId" `
	SourceUrlMd5   string `form:"sourceUrlMd5" `
	SourceTitleMd5 string `form:"sourceTitleMd5" `
	ArticleId      int64  `form:"articleId" `
	Status         int    `form:"status" binding:"required"`
}

//修改页面请求参数
type EditReq struct {
	Id             int64  `form:"id" binding:"required"`
	UserId         int64  `form:"userId" `
	RuleId         int64  `form:"ruleId" `
	LinkId         int64  `form:"linkId" `
	Title          string `form:"title" `
	Summary        string `form:"summary" `
	Content        string `form:"content" `
	ContentType    string `form:"contentType" `
	SourceUrl      string `form:"sourceUrl" `
	SourceId       string `form:"sourceId" `
	SourceUrlMd5   string `form:"sourceUrlMd5" `
	SourceTitleMd5 string `form:"sourceTitleMd5" `
	ArticleId      int64  `form:"articleId" `
	Status         int    `form:"status" binding:"required不能为空"`
}

//分页请求参数
type SelectPageReq struct {
	UserId         int64  `form:"userId"`         //用户id
	RuleId         int64  `form:"ruleId"`         //规则id
	LinkId         int64  `form:"linkId"`         //链接id
	Title          string `form:"title"`          //名称
	Summary        string `form:"summary"`        //总揽
	Content        string `form:"content"`        //内容
	ContentType    string `form:"contentType"`    //内容类型
	SourceUrl      string `form:"sourceUrl"`      //源地址
	SourceId       string `form:"sourceId"`       //源id
	SourceUrlMd5   string `form:"sourceUrlMd5"`   //源地址MD5
	SourceTitleMd5 string `form:"sourceTitleMd5"` //源名称MD5
	ArticleId      int64  `form:"articleId"`      //文章id
	Status         int    `form:"status"`         //0未审核 1正常状态 2审核未通过 3删除
	BeginTime      string `form:"beginTime"`      //开始时间
	EndTime        string `form:"endTime"`        //结束时间
	PageNum        int    `form:"pageNum"`        //当前页码
	PageSize       int    `form:"pageSize"`       //每页数
}
